<?xml version="1.0"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<article xmlns="http://docbook.org/ns/docbook">
  <section ID="parsed_directive_contents">
    <title>Parsed directive contents</title>
    <para>Custom "paragraph" directive reparsing tests</para>
    <section ID="awesome">
      <title>Awesome</title>
      <para>Some text here too</para>
      <section ID="comments">
        <title>Comments</title>
        <para>test</para>
        <literallayout>foo

</literallayout>
        <para>test</para>
        <literallayout>foo

</literallayout>
        <section ID="second_test">
          <title>Second test</title>
          <para>test2:</para>
          <literallayout>foo2

</literallayout>
          <para>test2:</para>
          <literallayout>foo2


</literallayout>
        </section>
        <para>&gt; Don't use "return ()", &gt; but just "return ".</para>
        <para>That's something I've always advocated, since "return" is a statement and not a function. (BTW: the manual is a bit misleading: <ulink url="http://www.php.net/manual/en/function.return.php)">http://www.php.net/manual/en/function.return.php)</ulink></para>
        <para>In the specific case, MDB (v.1.x) had a different "coding standard" I never completely agreed on (but I somewhat tolerated since I wasn't the lead developer), one of these being treating "return" as a function. Hence the parentesis. My comment in the CVS log was triggered by this consideration, I didn't see a single variable as an expression (your explanation makes sense, though, even if I'd welcome some flexibility in the parser).</para>
        <para>Nevertheless, there are other annoyances introduced by the PHP4.4 fix that are worth a second thought.</para>
        <para>For instance, as pointed out by Foo, this is no longer valid:</para>
        <literallayout>==========================
function &amp;foo() {
    return $var;
}
function &amp;bar() {
    return foo();
}
==========================

</literallayout>
        <para>My question is: why?</para>
        <para>Other annoyances are highlighted by John Lim here: <ulink url="http://phplens.com/phpeverywhere/?q=node/view/205">http://phplens.com/phpeverywhere/?q=node/view/205</ulink></para>
        <para>You seem to agree that</para>
        <para>$var = null; return $var;</para>
        <para>is a bit silly ;-)</para>
        <para>I'm 100% convinced about the intrinsic goodness of the patch, I just wonder if it could be a bit more flexible (for instance with null and bool values), that's it.</para>
        <para>Basically the only problem with strtotime() is that when there are two numeric fields which could be either day or month, it always uses US ordering.</para>
        <para>For locales other than the US, and php less than 5.3, the following kludge just swaps those two date elements in that case: this absolutely should be a flag argument to strtotime(), either to swap directly, or to swap if the locale requires it:</para>
        <literallayout>$fixed = $_POST['date'];
if (preg_match('/^s*(dd?)[^w](dd?)[^w](d{1,4}s*$)/', $y, $match)) {
      $y = $match[2] . '/' . $match[1] . '/' . $match[3];
}
echo date('d # m # Y', strtotime($fixed));





</literallayout>
      </section>
    </section>
  </section>
</article>
